package pl.freetimetool.domain;

import java.util.Collection;

import javax.persistence.Entity;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name = "manager")
public class Manager extends Account {

	private static final long serialVersionUID = -584626786175537795L;

	@OneToMany(mappedBy = "id", orphanRemoval = true, targetEntity = Worker.class)
	private Collection<Worker> workers;

	public Collection<Worker> getWorkers() {
		return this.workers;
	}

	public void setWorkers(final Collection<Worker> workers) {
		this.workers = workers;
	}

	public void addWorker(final Worker worker) {
		this.workers.add(worker);
	}

}
